package com.chenshu.demo2.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Objects;

/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2023-12-23
 * Time：14:45
 */

@RestController
public class Login {
    @RequestMapping("/login")
    public HashMap<String, Object> login(String username, String password) {
        HashMap<String, Object> res = new HashMap<>();
        int succ = 200;
        res.put("succ", succ);
        if (username != null && password != null && username.equals("admin") && password.equals("123456")) {
            res.put("msg", "登陆成功");
        } else {
            res.put("msg", "账号或密码错误，登陆失败！");
        }
        return res;
    }
}
